package com.jinrustar.weimaqi.action

import com.jinrustar.weimaqi.app.Constant
import com.jinrustar.weimaqi.util.ReflectUtil
import java.util.*

/**
 * Created by liduanwei on 2017/10/26 0026. liduanwei1988@gmail.com
 */
abstract class AbstractReqAction {
    protected var mch_id = Constant.MCH_ID
    protected var api_pw = Constant.API_PW

    abstract fun getAction(): String


    fun getAllFieldsWithValue(): java.util.TreeMap<String, Any> {
        val map = TreeMap<String, Any>()
        map.put("action", getAction())

        ReflectUtil.getAllFieldsAndValue(this.javaClass, this, map)
        return map
    }
}